package kr.hkit.javaproject.chapter000;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Lotto {
	public static void main(String[] args) {
		Set<Integer> lotto = new HashSet<>();
		Integer r = null;
		
		while(lotto.size() < 6){
			r = (int) (Math.random()*45 + 1);
			if(lotto.contains(r)){
				continue;
			}else{
				lotto.add(r);
			}
		}
		
		Iterator<Integer> it = lotto.iterator();
		while(it.hasNext()){
			r = it.next();
			System.out.print(r + "\t");
		}
	}
}
